/**
 * 
 */
package com.morningstar.qs.api.basic.util;


/**
 * @deprecated
 * @author rzeng
 * @deprecated
 *
 */
public class QTSymbol {
	
	/**
	 * @deprecated
	 * @param country
	 * @param exch
	 * @param exchSymbol
	 * @return
	 */
	public static String getTenforeSymbol(String country, String exch, String exchSymbol)
	{
		int indexOfPoint = exchSymbol.indexOf(".");
		if (indexOfPoint > 0)
		{
			String prefix = exchSymbol.substring(0, indexOfPoint);
			String suffix = exchSymbol.substring(indexOfPoint+1);
			if (suffix.startsWith("PR") && suffix.length() > 2)
			{
				String prSuffix = suffix.substring(2);
				if (country.equalsIgnoreCase("CA"))
				{
					exchSymbol = prefix + "/PR/" + prSuffix;
				}
				else if (country.equalsIgnoreCase("US"))
				{
					exchSymbol = prefix + "p" + prSuffix;
				}
			}
			else if (suffix.equalsIgnoreCase("PR") 
					&& (exch.equalsIgnoreCase("NYSE") ||exch.equalsIgnoreCase("AMEX")))
			{
				exchSymbol = prefix + "p";
			}
			else
			{
				exchSymbol = exchSymbol.replace('.', '/');
			}
		}
		return exchSymbol;
	}
	
	public static void main(String[] args) {
		String country = "";
		String exch = "";
		String exchSymbol = "";
		String ret = getTenforeSymbol(country, exch, exchSymbol);
		System.out.println(ret);
	}
}
